<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>

<body>
<input type="radio" id="option1" name="option" value="1">
<input type="radio" id="option2" name="option" value="2">
<input type="radio" id="option3" name="option" value="3">
<button id="submitButton">获取选中的单选框的值</button>
</body>
<script>
  // JavaScript部分
  document.getElementById('submitButton').addEventListener('click', function() {
    var selectedOption = document.querySelector('input[name="option"]:checked');
    if (selectedOption) {
      var selectedValue = selectedOption.value;
      alert('选中的单选框的值为：' + selectedValue);
    } else {
      alert('请先选择一个单选框');
    }
  });
</script>
</html>